macOS: ad-hoc sign builds when no Apple Developer Program cert is present#7
Merged
Merged
Conversation
CortexIDE no longer maintains a paid Apple Developer Program membership, so notarization fails with `HTTP 403: A required agreement is missing or has expired`. Until/unless that membership is reinstated, fall back to ad-hoc signing the .app bundle (`codesign --sign -`) when CERTIFICATE_OSX_P12_DATA is empty: - Sign nested helpers/frameworks/dylibs bottom-up, then the outer .app - Verify with `codesign --verify --deep --strict` - Skip notarytool submission and stapler entirely - DMG packaging still runs (existing `--no-code-sign` fallback already handles the empty CODESIGN_IDENTITY case) The identity-based signing + notarization path is preserved verbatim and reactivates automatically the moment the secrets are restored. No changes to Linux or Windows pipelines, no new dependencies. Pair this with the website install-instructions PR so Mac users know they need to right-click → Open (or `xattr -cr`) on first launch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CortexIDE no longer maintains a paid Apple Developer Program membership. The last macOS release run failed at the notarization step with:
xcrun notarytoolrequires an active membership; there is no free path to Apple-notarized builds. Rather than blocking macOS releases entirely while the membership question is sorted out, this PR ships ad-hoc-signed.dmg/.zipbuilds — the same approach used by VSCodium, MacVim, and most open-source Mac apps.What changes
prepare_assets.sh— theif [[ -n "${CERTIFICATE_OSX_P12_DATA}" ]]block now has anelsebranch that:.appinVSCode-darwin-${VSCODE_ARCH}/.*.dylib,*.framework,*.node, and nested*.app(helpers) viacodesign --force --sign - --timestamp=none..appwith--deep.codesign --verify --deep --strict --verbose=2.xcrun notarytool submitandxcrun stapler stapleentirely.The existing DMG block already falls back to
npx create-dmg --no-code-signwhenCODESIGN_IDENTITYis empty, so the.dmgand.zipartifacts are produced unchanged in name and location. Output filenames stayCortexIDE.x64.${version}.dmg/CortexIDE.arm64.${version}.dmg, socortexide-website's download URLs keep working.Why ad-hoc instead of unsigned
A fully-unsigned bundle won't load on Apple Silicon — dyld rejects unsigned hardened binaries at runtime. Ad-hoc signing (
codesign --sign -) is free, requires no Apple account, and makes the bundle structurally valid (nested Helpers verify, all Mach-Os have a code-directory). Gatekeeper still shows the "cannot verify the developer" prompt on first launch; the companion website PR documents how users bypass it.Backwards compatibility
If a contributor later restores
CERTIFICATE_OSX_P12_DATA+ the rest of the Apple secrets, the existing identity-signing + notarization + stapling path activates automatically with no further code changes. The gate is the same env var the script already checked.Out of scope
webhook agentLinux/Windows release failuresvscode/build/darwin/sign.tsTest plan
workflow_dispatchon this branch withgenerate_assets=trueand no Apple secrets exposed; confirm the "ad-hoc signing" log line appears,codesign --verifypasses, and.dmg+.zipartifacts upload..dmg, mount, drag to/Applications, attempt to launch — Gatekeeper should show "unverified developer" (expected), and the right-click → Open workaround should succeed.CERTIFICATE_OSX_P12_DATApopulated (if/when membership is restored) to confirm the original identity-signing path is unaffected.Required follow-up
Pair with the install-instructions PR on
cortexide-websiteso users have a clear path through the Gatekeeper prompt.